# FindOpenBLAS.cmake
find_path(OpenBLAS_INCLUDE_DIR openblas_config.h
  PATHS ${CPM_SOURCE_CACHE}/OpenBLAS/include)

find_library(OpenBLAS_LIB
  NAMES openblas
  PATHS ${CPM_SOURCE_CACHE}/OpenBLAS/lib)

include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(OpenBLAS DEFAULT_MSG
                                  OpenBLAS_LIB OpenBLAS_INCLUDE_DIR)

if(OpenBLAS_FOUND)
  set(OpenBLAS_LIBRARIES ${OpenBLAS_LIB})
  set(OpenBLAS_INCLUDE_DIRS ${OpenBLAS_INCLUDE_DIR})
endif()